<include file="../Public/header" />
<script data-main="__PUBLIC__/admin/js/page/admin/global/editcredit" src="__PUBLIC__/admin/js/lib/requirejs/require.js"></script>
</head>

<body>

  <div class="page">
    <div class="page-hd">
      <h1>{$Think.lang.creditConfig}</h1>
    </div>
    <div class="navbar">
      <ul class="nav">
        <li class="active"><a href="#">{$Think.lang.creditRule}</a>
        </li>
        <li class="{$creditType_tab}"><a href="{:URL('admin/Global/creditType')}">{$Think.lang.creditType}</a>
        </li>
        <li class="{$creditUser_tab}"><a href="{:URL('admin/Global/creditUser')}">{$Think.lang.creditUser}</a>
        </li>
      </ul>
    </div>

    <div class="form">
      <php>if($type=="edit") {</php>
      <form method="post" action="{:URL('admin/Global/doEditCredit')}" enctype="multipart/form-data">
        <php>}else {</php>
        <form method="post" action="{:URL('admin/Global/doAddCredit')}" enctype="multipart/form-data">
          <php>}</php>
          <!--           <div class="page-hd">
            <h5 class="section-ti">
              <eq name="type" value="edit">{$Think.lang.editCreditRule}
                <else />{$Think.lang.addCreditRule}</eq>
            </h5>
          </div> -->
          <dl class="kv">
            <dt>{$Think.lang.Name}：</dt>
            <dd>
              <input class="input-text" name="name" id="name" type="text" value="{$credit['name']}" required>
              <input name="id" value="{$credit['id']}" style="display:none;">
              <p class="tip">{$Think.lang.CreditRuleNameRe}</p>
            </dd>
          </dl>
          <dl class="kv">
            <dt>{$Think.lang.alias}：</dt>
            <dd>
              <input class="input-text" name="alias" id="alias" type="text" value="{$credit['alias']}">
              <p class="tip">{$Think.lang.CreditRuleAliasRe}</p>
            </dd>
          </dl>
          <dl class="kv">
            <dt>{$Think.lang.type}：</dt>
            <dd>
              <input class="input-text" name="type" id="type" type="text" value="{$credit['type']}">
              <p class="tip">{$Think.lang.CreditRuleNameType}</p>
            </dd>
          </dl>
          <volist name="creditType" id="ct">
            <dl class="kv">
              <dt>{$ct.alias}{$Think.lang.incremental}：</dt>
              <dd>
                <input class="input-text" name="{$ct.name}" id="{$ct.name}" type="number" value="{$credit[$ct['name']]|intval}" required>
                <p class="tip">{$Think.lang.incrementalRule}</p>
              </dd>
            </dl>
          </volist>
          <div class="actions">
            <input type="submit" class="btn btn-y" value="{$Think.lang.OK}" />
            <a href="{:URL('admin/Global/credit')}" class="btn btn-n">{$Think.lang.return}</a>
          </div>
        </form>
    </div>
  </div>
</body>

</html>
